package 青蛙跳台阶问题;

public class Solution {
    public static void main(String[] args) {
        System.out.println(numWays(7));
    }

    /*public int numWays(int n) {
        int sum = 0;

        return sum;
    }*/

    public static int numWays(int n) {
        if(n == 0)
            return 1;
        int sum = 0;
        int last = 1;
        for (int i = 1; i <= n; i++) {
            if(i == 1){
                sum+= 1;
                //134903163
            }
            else{
                sum = sum + last;
                last = sum - last;
            }
            sum = sum % 1000000007;
            last = last % 1000000007;
        }
        return sum;
    }
}
